
public class Sphere {

	private double radius, xCenter, yCenter;

	public Sphere(double radius, double xCenter, double yCenter) {

		if(radius < 0 )
			throw new IllegalArgumentException("Error: r < 0.");

		this.radius = radius;
		this.xCenter = xCenter;
		this.yCenter = yCenter;

	}

	public Sphere (Sphere s1) {
		radius  = s1.radius;
		xCenter = s1.xCenter;
		yCenter = s1.yCenter;	
	}

	public String toString() {
		return "Radius: " + this.radius + " cm, Center: (" + this.xCenter + " , " + this.yCenter + ")";
	}

	public boolean equals(Object other) {
		if (other instanceof Sphere) {
			Sphere otherSphere = (Sphere) other;
			if (otherSphere.radius == this.radius && otherSphere.xCenter == this.xCenter && otherSphere.yCenter == this.yCenter)
				return true;

			else
				return false;
		}
		else
			return false;
	}


	public double getxCenter() {
		return this.xCenter ;
	}

	public double getRadius() {
		return this.radius ;
	}

	public double getyCenter() {
		return this.yCenter ;
	}

	public void setRadius (double radius) {
		if (radius < 0 )
			throw new IllegalArgumentException("Error: Dimension <= 0");

		this.radius = radius;
	}

	public void setyCenter (double yCenter) {
		this.yCenter = yCenter;
	}

	public void setxCenter (double xCenter) {
		this.xCenter = xCenter;
	}

	public double Volume() {
		double volume = (4.0/3) * Math.PI * Math.pow(this.radius, 3);
		return volume;
	}

	public double surfaceArea() {
		double surfaceArea = 4.0 * Math.PI * Math.pow(this.radius, 2);
		return surfaceArea;
	}



}
